package mydesign.chapters02_observer.v1;

import mydesign.chapters02_observer.v1.Observer.LisiSubscriber;
import mydesign.chapters02_observer.v1.Observer.ZhangsanSubscriber;

public class TestMain {


    public static void main(String[] args) {
        Subject subject = new Newspaper();
        ZhangsanSubscriber zhangsanSubscriber = new ZhangsanSubscriber();
        subject.registerOberserver(zhangsanSubscriber);
        subject.registerOberserver(new LisiSubscriber());
        subject.setChange("特大消息中国高铁震惊世界");
        subject.removeOberserver(zhangsanSubscriber);

        System.out.println("==============================");

        subject.setChange("特大消息中国人口突破14亿");
    }


}
